<template>
  <q-page>
    <div class='page-content'>
      <div align='center' v-if='reportData !== undefined'>
        <div>
          <Certification v-if="!reportData.test.check.flood.status&&!reportData.test.check.burnd.status&&!reportData.test.check.crashed.status" :width='pageSize.width' :height='pageSize.height' :report-data='reportData' qrcode-type='sanwu'/>
        </div>
      </div>
    </div>
  </q-page>
</template>

<script lang='ts'>
import { defineComponent, onMounted, ref, watch } from 'vue';
import Cover from './inpage/Cover.vue'
import Certification from './inpage/Certification.vue';
import Bail from './inpage/Bail.vue';
import Car from './inpage/Car.vue';
import Accident from './inpage/Accident.vue';
import Flood from './inpage/Flood.vue';
import Burned from './inpage/Burned.vue';
import AccidentJudge from './inpage/AccidentJudge.vue';
import FloodJudge from './inpage/FloodJudge.vue';
import BurnedJudge from './inpage/BurnedJudge.vue';
import Provision from './inpage/Provision.vue';
import PageBottom from './inpage/PageBottom.vue'
import AfterSales from './inpage/AfterSales.vue';
import { FetchData } from './ts/FetchData'
import { useRoute } from 'vue-router';
export default defineComponent({
  name: 'report',
  components: { AfterSales, PageBottom,Provision, BurnedJudge, FloodJudge, AccidentJudge, Burned, Flood, Accident, Car, Bail, Certification, Cover},
  setup () {
    const pageSize = {
      width: "null",
      height: "null"
    }
    let rote = useRoute();
    let reportData = ref();
    const uuid = <string> rote.query.uuid;
    new FetchData(uuid,(res) => {
      console.log(res.test.check.crashed.checkItem.slice(0,8))
      console.log(res.test.check.crashed.checkItem.slice(8,16))
      console.log(res)
      reportData.value = res
    },"uuid");


    return {
      pageSize,
      reportData
    }
  }
});
</script>

<style scoped lang='sass'>
  //.page-content
  //  width: vw
  .page-item
    width: 100%
  .page-footer
    width: 100%
    margin-top: 60px
</style>
